package com.java_demo.demo;

import com.java_demo.dao.IContactDao;
import com.java_demo.domain.Contact;
import com.java_demo.utils.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

public class Demo_02 {
    public static void main(String[] args) {
        SqlSession session = MyBatisUtil.getSession();

        IContactDao contactDao = session.getMapper(IContactDao.class);

        //int i = contactDao.addContact(101L, "圣枪游侠");
       // System.out.println(i);

        Contact contact = contactDao.queryByIdWithCustomer(101L, "圣枪游侠");
        System.out.println(contact);

        session.commit();
        session.close();
    }
}
